home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19970626-19970929 / 000267_news@newsmaster….columbia.edu _Sat Aug 30 14:24:39 1997.msg < prev    next >
Internet Message Format  |  2020-01-01  |  3KB

  1. Return-Path: <news@newsmaster.cc.columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id OAA28339
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Sat, 30 Aug 1997 14:24:39 -0400 (EDT)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id OAA26825
  7.     for kermit.misc@watsun; Sat, 30 Aug 1997 14:24:38 -0400 (EDT)
  8. Path: news.columbia.edu!panix!news.eecs.umich.edu!newsxfer3.itd.umich.edu!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!cs.utexas.edu!news.cs.utah.edu!cc.usu.edu!jrd
  9. From: jrd@cc.usu.edu (Joe Doupnik)
  10. Newsgroups: comp.protocols.kermit.misc
  11. Subject: Re: read \&c[1] does not change the value of the array element
  12. Message-ID: <1K7GSuoXGEbT@cc.usu.edu>
  13. Date: 30 Aug 97 11:11:11 MDT
  14. References: <3405a590.4114629@news.calvacom.fr>
  15. Organization: Utah State University
  16. Lines: 45
  17. Xref: news.columbia.edu comp.protocols.kermit.misc:7584
  18.  
  19. In article <3405a590.4114629@news.calvacom.fr>, do11@calva.net (Dominique Ottello) writes:
  20. > Hello, it seems there is a problem with read {array element} with MS-DOS
  21. > Kermit 3.15
  22. > The command for \%i 1 4 1 {read \&c[\%i]} does not change the content of
  23. > the array element, the command for \%i 1 4 1 {read \%a,assign \&c[\%i] \%a}
  24. > does
  25. > Comments please.
  26. > Best regards,
  27. > for \%i 1 4 1 {assign \&c[\%i] Line \%i}
  28. > for \%i 1 4 1 {Echo {Must be Line : \&c[\%i]}}
  29. > echo
  30. > open write ENTRYPTS.DAT
  31. > for \%i 1 4 1 {write file Line \%i\13\10}
  32. > close write-file
  33. > ;
  34. > for \%i 1 4 1 {assign \&c[\%i] Test \%i}
  35. > for \%i 1 4 1 {Echo {Must be Test : \&c[\%i]}}
  36. > echo
  37. > open read ENTRYPTS.DAT
  38. > for \%i 1 4 1 {read \&c[\%i]}
  39. > close read-file
  40. > for \%i 1 4 1 {Echo {Must be Line : \&c[\%i]}}
  41. > echo
  42. ---------------
  43.     That's a real bug. It is now fixed, thanks to your report.
  44.     For those who have an interest in internal matters, arrays have
  45. a special problem in that an array element's identification has both the 
  46. name of the array and possibly a substitution variable as a subscript,
  47. all in one syntatical unit. 
  48.     In certain situations we wish retain the name portion of the array,
  49. say \&c, but also to replace the possible substitution variable subscript 
  50. with its value. We see this above in  read \&c[\%i]  where we need to retain
  51. \&c[value]  literally as the place where results go. In other situations,
  52. such as  Echo \&c[\%i], we wish to replace the sub variable \%i with its value 
  53. and also replace the array element with its value. 
  54.     The different approaches are dictated by whether the array element is
  55. a destination (left hand side of a replacement operation, an "l-value") or a 
  56. source term (right hand side) in an expression. The READ command failed to
  57. signal l-value-ness for arrays.
  58.     Thanks,
  59.     Joe D.